<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        var height = parseFloat(prompt("请输入身高，单位是米"));
        var weight = parseFloat(prompt("请输入体重，单位是公斤"));
        //var height = prompt("请输入身高，单位是米");
        //var weight = prompt("请输入体重，单位是公斤");
        var BMI = weight / Math.pow(height, 2);
        if (BMI < 18.5) {
            alert("偏瘦");
        } else if (BMI < 25) {
            alert("正常");
        } else if (BMI < 28) {
            alert("过重");
        } else if (BMI <= 32) {
            alert("肥胖");
        } else {
            alert("非常肥胖");
        }
    </script>
</body>

</html>